<template>

  <!--天气模块-->
  <div>


    <div style="width: 320px;height: 210px;background-image: linear-gradient(80deg, #19c2a5, #034d98);
};border-radius:15px;">
      <div v-if="this.$route.query.name !=null">
      <h2 style="margin: 0 0 0 10px">管理员:</h2>
      <h1 style="font-size: 40px;margin: 10px 0 0 10px">{{ this.$route.query.name }}</h1>
        <i class="el-icon-user-solid" style="font-size: 120px"></i>
        <router-link to='/'>
          <el-button style="margin: -60px 15px 20px 170px;float: right"
              type="primary" round >退出登录<i class="el-icon-back el-icon--right"></i>
          </el-button>
        </router-link>
      </div>
<!--      @click="logout()-->
      <div v-else><!--没有登录时显示下面内容-->
        <a href="/">登录</a>
      </div>
  </div>

    <div style="margin: 20px 0 0 0" class="info_weather"><div id="he-plugin-standard"></div></div>



  <el-calendar
      style="width: 320px;
                   height: 635px;
                   background-color: #ececec;
                   margin: 15px 0 0 0;
                   border-radius:15px;">
  </el-calendar>

  <div class="block" style="float:left;margin: -1050px 0 0px 300px ">
    <el-timeline>
      <el-timeline-item timestamp="2018/4/12" placement="top">
        <el-card>
          <h4>更新 Github 模板11111111111111111111111111111111111</h4>
          <p>王小虎 提交于 2018/4/12 20:46</p>
        </el-card>
      </el-timeline-item>
      <el-timeline-item timestamp="2018/4/3" placement="top">
        <el-card>
          <h4>更新 Github 模板</h4>
          <p>王小虎 提交于 2018/4/3 20:46</p>
        </el-card>
      </el-timeline-item>
      <el-timeline-item timestamp="2018/4/2" placement="top">
        <el-card>
          <h4>更新 Github 模板</h4>
          <p>王小虎 提交于 2018/4/2 20:46</p>
        </el-card>
      </el-timeline-item>
    </el-timeline>
  </div>




  </div>
</template>

<script>
export default {
  return: {
    admin: [],
    value: new Date(),
  },
  mounted() {
    this.weathers();
  },
  methods: {
    logout(){
      axios.get("/logout").then(function (response) {
        //修改user的值  页面会跟着发生改变
       this.name={};
      })
    },
    // 获取天气
    weathers() {
      // 到和风天气官网设计和下载 https://widget.qweather.com/
      window.WIDGET = {
        CONFIG: {
          layout: "1",
          width: "320",
          height: "210",
          background: "1",
          dataColor: "FFFFFF",
          borderRadius: "15",
          key: "9f5cb7d9725e483f95457d258eaba2cb",
        },
      };
      var script = document.createElement("script");
      script.type = "text/javascript";
      script.src =
          "https://widget.qweather.net/standard/static/js/he-standard-common.js?v=2.0";
      document.getElementsByTagName("head")[0].appendChild(script);
    },// 获取天气结束
  }
}

</script>

<style scoped>

</style>